#! /bin/bash

key="$1"
shift 1
content="$@"

if test -z "$key"; then
    echo "key name required"
    exit 1
fi

if test -z "$content"; then
    echo "content required"
    exit 1
fi

now=`date +%s%N`
stash=`expr "$now" - 1`

redis-cli --eval ./enqueue.lua "$key-stash" "$key-queue" , "$stash" "$now" "$content"
